function download(src, name) {
  // 创建隐藏的可下载链接
  var eleLink = document.createElement('a');
  eleLink.href = src;
  eleLink.download = name;
  eleLink.style.display = 'none';
  eleLink.href = src;
  document.body.appendChild(eleLink);
  eleLink.click();
  document.body.removeChild(eleLink);
}